<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js2</title>

    <script>
        function cishu(str) {
            var count = 0;
            for (var j = 0; j < str.length; j++) {
                var data = str.charAt(j);
                if (data == 'a') {
                    count++;
                    // C:\Program Files\nodejs\
                }
            }
            return count;
        }

        var count = cishu("abcaaacccccc")
        console.log(count)
    </script>

</head>
<body>
</body>
</html>